package com.tangding.hprose.api.server.command.impl.game;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.tangding.cache.GamesConfigCache;
import com.tangding.common.exception.GException;
import com.tangding.hprose.api.server.command.Command;
import com.tangding.hprose.api.server.command.Response;
import com.tangding.service.dao.games.config.GamesConfigRepository;

/**
 * @description 
 *
 * @author Ranger
 * @version 2017年12月26日_上午11:17:29
 *
 */
@Component
public class QueryGameSettings implements Command{
	
	@Autowired
	GamesConfigRepository configRepository;

	@Override
	public Response exe(Object... params) throws GException {
		String gameName = (String) params[0];
		/*Map<String, Object> data = new HashMap<>();
		data.put("head", configRepository.getNormalDataConfigs(gameName));
		List<Node> nodes = configRepository.getZhxDataConfigs(gameName);
		if (nodes != null) {
			data.put("zhx", nodes);
		}
		data.put("bigRewards", configRepository.getJackpotDataConfigs(gameName));*/
		Object data = GamesConfigCache.configs.get(gameName);
		return doResponseSucc(data);
	}

}
